﻿namespace CommonData.Data.Core
{
    using CommonData.Entity;
    using CommonData.Model.Core;
    using System;
    using System.Collections.Generic;

    public interface IDbHelper : IDisposable
    {
        int Add(IEntity entity);
        int Add<T>(T t) where T: IEntity;
        int Add(Type type, object value);
        int Delete<T>(T t) where T: class;
        int Delete(IEntity entity);
        int Delete<T>(T t, string propertyName) where T: class;
        int Delete(IEntity entity, string[] propertyNames);
        int Delete(Type type, object value);
        int Delete<T>(T t, string[] propertyNames) where T: class;
        int Delete(IEntity entity, string propertyName);
        int Delete(Type type, object value, string propertyName);
        int Delete(Type type, object value, string[] propertyNames);
        int GetCount<T>() where T: class;
        int GetCount(Type type);
        int GetCount(Type type, IDictionary<string, object> dic, ConditionComponent component);
        T GetEntity<T>(object pkPropertyValue) where T: class;
        T GetEntity<T>(IEntity entity, string[] propertyNames) where T: class;
        T GetEntity<T>(string propertyName, object propertyValue) where T: class;
        object GetEntity(Type type, object pkPropertyValue);
        object GetEntity(Type type, IEntity entity, string[] propertyNames);
        object GetEntity(Type type, string propertyName, object propertyValue);
        IList<T> GetList<T>() where T: class;
        IList<T> GetList<T>(IDictionary<string, object> dic) where T: class;
        IList<T> GetList<T>(IDictionary<string, object> dic, ConditionComponent component) where T: class;
        IList<T> GetList<T>(string propertyName, object value) where T: class;
        int Update(IEntity entity);
        int Update<T>(T t) where T: IEntity;
        int Update<T>(T t, string[] propertyNames) where T: IEntity;
        int Update(IEntity entity, string[] propertyNames);
        int Update(IEntity entity, string propertyName);
        int Update<T>(T t, string propertyName) where T: IEntity;
        int Update(Type type, object value);
        int Update(Type type, object value, string[] propertyNames);
        int Update(Type type, object value, string propertyName);
    }
}

